|
|
|
|
|
|
|
Printing and exporting the report is done by using one of two methods. The first method is done within the code and allows the user to print or export the report without previewing itby using either the Data Reports PrintReport or ExportReport method. Using the PrintReport method is very simple; you simply add a single line of code that prints the report: |
|
|
|
|
|
|
|
|
However, the ExportReport method requires several parameters in order for it to know how to export the report and where to place it. The following is the syntax for the command: |
|
|
|
|
|
|
|
|
object.ExportReport(index, filename, Overwrite, ShowDialog, Range, PageFrom, PageTo) |
|
|
|
|
|
|
|
|
Each of these parameters enables you to customize the export process. Table 12.4 lists each parameter and its description. |
|
|
|
|
| TABLE 12.4. THE PARAMETERS FOR THEExportReportMETHOD. | | Parameter | Description | | object | This references the Data Report you want to export. | | index | This specifies the export format to use. | | filename | This specifies the name of the file to export the report to. | | overwrite | If True, the file will be overwritten. | | showDialog | This specifies whether the Save As dialog should be displayed. | | range | This sets an integer that determines whether all the pages in the report will be exported. | | PageFrom | This is the starting page of the export. | | PageTo | This is the ending page of the export. |
|
|
|
|
|
|
An example of this command would be the following: |
|
|
|
|
|
|
|
|
drCustOrders.ExportReport rptKeyHTML, C:\temp\custord, True, False |
|
|
|
|
|
|
|
|
The second way the user can print or export a report is by using the available buttons at the top of the Report Preview Form (see Figure 12.20). These provide the same functionality as the methods, only the user must first preview the report. |
|
|
|
|
|